// 路由工具函数
import { getRouter } from '@/utils/index'

/**
 * 权限认证
 * Auth:
 * 无该字段 通用权限
 * admin 管理员
 * users 普通用户
 * 例子：auth:Array|String = ['admin', 'users']
 * @type {{path: string, name: string}[]}
 */
const publicRoute = [
  {
    path: '/index',
    component: getRouter('public', 'Layout'),
    redirect: 'homePage',
    children: [
      {
        path: '/',
        name: 'HomePage',
        component: getRouter('views', 'HomePage'),
        meta: {
          name: '首页'
        }
      },
      {
        path: '/button',
        name: 'button',
        component: getRouter('views', 'Button'),
        meta: {
          name: '按钮模块'
        }
      },
      {
        path: '/area',
        name: 'area',
        component: getRouter('views', 'Area'),
        meta: {
          name: '面积图表'
        }
      },
      {
        path: '/group/baidu',
        name: 'baidu',
        component: getRouter('views', 'Map/Baidu'),
        meta: {
          name: '百度地图'
        }
      },
      {
        path: '/group/gaode',
        name: 'gaode',
        component: getRouter('views', 'Map/Gaode'),
        meta: {
          name: '高德地图'
        }
      }
    ]
  }
]

export default publicRoute
